import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import "../components" as Components
import "../styles" as Styles

Page {
    id: analyticsScreen
    title: qsTr("数据分析")

    background: Rectangle {
        color: Styles.Theme.background
    }

    ColumnLayout {
        anchors.fill: parent
        anchors.margins: Styles.Theme.spacingNormal
        spacing: Styles.Theme.spacingNormal

        Rectangle {
            Layout.fillWidth: true
            Layout.fillHeight: true
            color: Styles.Theme.surface
            border.color: Styles.Theme.border
            border.width: 1
            radius: Styles.Theme.radiusNormal

            ColumnLayout {
                anchors.centerIn: parent
                spacing: Styles.Theme.spacingSmall

                Text {
                    text: qsTr("数据分析")
                    color: Styles.Theme.textPrimary
                    font.pixelSize: Styles.Theme.fontSizeLarge
                    font.weight: Styles.Theme.fontWeightMedium
                    horizontalAlignment: Text.AlignHCenter
                }

                Text {
                    text: qsTr("数据分析视图建设中")
                    color: Styles.Theme.textSecondary
                    font.pixelSize: Styles.Theme.fontSizeNormal
                    horizontalAlignment: Text.AlignHCenter
                }

                Text {
                    text: qsTr("可扩展任务统计、AGV效率等可视化图表")
                    color: Styles.Theme.textSecondary
                    font.pixelSize: Styles.Theme.fontSizeSmall
                    horizontalAlignment: Text.AlignHCenter
                }

                Components.ActionButton {
                    Layout.alignment: Qt.AlignHCenter
                    text: qsTr("返回仪表盘")
                    buttonType: "secondary"
                    visible: analyticsScreen.StackView.view !== undefined
                    onClicked: {
                        if (analyticsScreen.StackView.view) {
                            analyticsScreen.StackView.view.pop()
                        }
                    }
                }
            }
        }
    }
}
